<?php

namespace maotool\util;

use maotool\match\UrlMatcher;

/**
 * Url 路径模式匹配工具
 */
class UrlMatcherUtil
{

    public static function match($pattern, $path, array $patterns = [])
    {
        $urlMatcher = new UrlMatcher();
        return $urlMatcher->match($pattern, $path, $patterns);
    }

    public static function parse($pattern, $path, array $patterns = [])
    {
        $urlMatcher = new UrlMatcher();
        return $urlMatcher->parse($pattern, $path, $patterns);
    }

    public static function replace($path, $key, $value)
    {
        $urlMatcher = new UrlMatcher();
        return $urlMatcher->replace($path, $key, $value);
    }

    public static function replaceAll($path, array $replacements)
    {
        $urlMatcher = new UrlMatcher();
        return $urlMatcher->replaceAll($path, $replacements);
    }

}